From: Jasper St. Pierre Date: Wed, 12 Jun 2013 07:35:28 +0000 (-0400) Subject: popupMenu: Ensure that submenus are properly hidden when insensitive X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3936 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4b889eac32eb2b53fcd17f822f0424697b349848;p=gnome-shell.git popupMenu: Ensure that submenus are properly hidden when insensitive We don't actually propagate sensitivity information to submenus; we simply make sure that they can never be open when the parent is insensitive. https://bugzilla.gnome.org/show_bug.cgi?id=702539 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index e14f75d4f..5918c93f6 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1340,6 +1340,13 @@ const PopupSubMenuMenuItem = new Lang.Class({ this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged)); }, + syncSensitive: function() { + let sensitive = this.parent(); + this._triangle.visible = sensitive; + if (!sensitive) + this.menu.close(false); + }, + _subMenuOpenStateChanged: function(menu, open) { if (open) this.actor.add_style_pseudo_class('open');